<template>
  <div class="boa war">
    <!-- 版心区域 -->
    <div class="area-center">
      <!-- 人才库区域 -->
      <head-page title="人才库" backUrl="../home"> </head-page>
      <!-- 用户单位文字区域 -->
      <div class="umit title-center">
        <div class="xiao flex aic m-t-07" @click="personcity(city)">
          <div class="left">
            <div class="yuan"></div>
          </div>
          <div :class="['zhong']">
            {{ city }}
          </div>
        </div>
        <div
          class="xiao flex aic m-t-07"
          v-for="(item, index) in list"
          :key="index"
          @click="person(item.listId, item.listName)"
        >
          <div class="left">
            <div class="yuan"></div>
          </div>
          <div :class="['zhong', item.listId == typeId ? 'active' : '']">
            {{ item.listName }}
          </div>
        </div>
      </div>
      <div class="fcc bold-700 m-t-20">{{ content.title }}</div>
      <div class="richText" v-html="content.context"></div>
    </div>
  </div>
</template>

<script>
import { personType, findById } from "@/api/index";
export default {
  data() {
    return {
      list: [],
      content: {},
      typeId: "",
      city: sessionStorage.getItem("province") + "人才储备信息",
    };
  },
  mounted() {
    personType().then((res) => {
      let data = res.data;
      if (data.code == 200) {
        this.list = data.data;
      }
    });
    this.typeId = this.$route.query.id;
    if (this.typeId) {
      this.person(this.typeId);
    }
  },
  methods: {
    //跳转
    // person(id,title) {
    // 	if (id == '11') {
    // 		this.content = {}
    // 		this.$router.push({path:"/personsix",query:{id}})
    // 	} else if (id == '12' || id == '13') {
    // 		this.typeId = id
    // 		findById({ otherId: id }).then(res => {
    // 			let data = res.data
    // 			if (data.code == 200) {
    // 				this.content = data.data
    // 				this.content.context = this.dataHTML(this.content.context)
    // 			}
    // 		})
    // 	} else {
    // 		this.content = {}
    // 		this.$router.push({path:"/personfour",query:{id,title}})
    // 	}

    // },
    person(id, title) {
      if (id == "48") {
        // this.content = {}
        this.$router.push({ path: "/personsix", query: { id, title } });
      } else if (id == "14") {
        this.$router.push({ path: "/personfour", query: { id, title } });
      } else {
        this.content = {};
        this.$router.push({ path: "/personfour", query: { id, title } });
      }
    },
    personcity(title) {
      this.$router.push({ path: "/person", query: { title } });
    },
  },
};
</script>

<style scoped>
/* 整体区域 */
.boa {
  width: 100%;
  min-height: 1rem;
  display: flex;
  justify-content: center;
  margin-top: 0.05rem;
}
/* 版心区域 */
.center {
  width: 98%;
  min-height: 2.8rem;
  /* background-color: rebeccapurple; */
}
/* 访谈和电视总区域 */
.tp {
  width: 100%;
}
.top {
  background-color: #f0eff5;
}
.wen {
  width: 100%;
  height: 25%;
  display: flex;
  justify-content: center;
}
.xian {
  width: 98%;
  height: 100%;
  display: flex;
  border-bottom: 2px solid #dad9df;
}
.title-icon {
  width: 0.24rem;
  margin-right: 0.05rem;
}
.le {
  width: 40%;
  height: 100%;
  line-height: 0.3rem;
  font-size: 0.18rem;
  padding-left: 0.1rem;
}
.le img {
  height: 0.3rem;
  float: right;
  padding: 0.05rem 0.1rem 0 0;
}

/* 用人单位区域 */
.umit {
  width: 100%;
  min-height: 0.4rem;
}
.xiao {
  width: 100%;
  display: flex;
}
/* 左边区域 */
.xiao .left {
  width: 5%;
  height: 100%;
  margin-left: 0.1rem;
}
.yuan {
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  background-color: black;
}

/* 中间区域 */
.zhong {
  height: 100%;
  line-height: 0.3rem;
  padding-left: 0.05rem;
  display: inline-block;
}

/* 底部区域 */
.bottom {
  width: 100%;
  height: 100%;
  margin-top: 0.1rem;
}

.bottom h3 {
  width: 100%;
  height: 0.35rem;
  text-align: center;
}
/* 内容区域 */
.context {
  width: 100%;
  height: 1rem;
  font-weight: 700;
}
</style>